package Teacher;

import java.awt.*;
import java.sql.*;

import javax.swing.*;

import Database.*;
import Exception.*;
import General.*;

public class MainPanel extends JPanel
{
	private JLabel labelSlogan, labelElsaIcon, labelElsa;
	
	public MainPanel(CallDB callDB, Connection connection) throws LoadDriverException, CheckDataException
	{	
		setLayout(null);
		
		createComponent();
		showComponent();
	}
	
	public void createComponent() throws CheckDataException
	{
		labelElsaIcon = new JLabel("");
		labelElsaIcon.setIcon(new ImageIcon("image/ElsaIcon.png"));

		labelElsa = new JLabel("ELSA");
		labelElsa.setHorizontalAlignment(SwingConstants.LEFT);
		labelElsa.setFont(new Font("Constantia", Font.ITALIC, 88));
		
		labelSlogan = new JLabel("Assessment Time Management");
		labelSlogan.setFont(new Font("Constantia", Font.ITALIC, 15));
	}
	
	public void showComponent()
	{
		labelElsaIcon.setBounds(30, 40, 117, 135);
		labelElsa.setBounds(130, 70, 221, 91);
		labelSlogan.setBounds(130, 150, 221, 16);
		
		this.add(labelElsaIcon);
		this.add(labelElsa);
		this.add(labelSlogan);
		
		GraphicsSetting.setBackground(this, "image/Bg-Main.jpg", 0, 0, 800, 600);		// image/main.png
	}
}